<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
<title>运营平台</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="renderer" content="webkit">
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/common.css?v=20170207" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/table.css?v=20170117" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/jquery-ui.css" />
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-1.11.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ui.min.js" type="text/javascript"></script>
 <script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/yunIndex.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ym-datePlugin-0.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/global.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/cheshan/js/common.js" type="text/javascript"></script>
<script type="text/javascript" src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery.placeholder.min.js"></script>
<script type="text/javascript">
 $(function(){
     $("input").placeholder();
     if (navigator.userAgent.indexOf("Safari") > -1) {
       $("input").css("lineHeight","normal !important");
     };
});
</script>

<body>
<div class="header">
<div class="headerCo">
<span>你好,<?php echo ($user_info["real_name"]); ?><a href="<?php echo (WEB_URL); ?>Emp/logout">退出</a></span>
<h1><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_logo.jpg"></h1>
</div>
</div>
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/cashier.css" />
<div class="mian">
    <div class="mianL">
    <dl>
        <dd>
            <a id="menu_sy" href="/Index/index" class="shouye">首页</a>
        </dd>
        <?php foreach ($tree_menu as $key => $value): ?>
          <dd>
            <span id="menu_<?php echo ($value['first_char']); ?>" ><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_jia.jpg"><?php echo ($value['name']); ?></span>
            <ul style="display: none;">
                <?php if (!empty($value['children'])): ?>
                    <?php foreach ($value['children'] as $k => $v): ?>
                        <li><a id='menu_<?php echo ($v["first_char"]); ?>' href="<?php echo ($v['url']); ?>"><?php echo ($v['name']); ?></a></li>
                    <?php endforeach ?>
                <?php endif ?>
            </ul>
        <?php endforeach ?>
    </dl>
</div>

<?php $menu = 'clcwht.tpsh'; ?>
<?php $menu=json_encode(explode('.', $menu)); ?>
<script>
    $(function () {
        var cur_menu = '<?php echo ($menu); ?>', cur_menu = eval('[' + cur_menu + ']'), cur_menu = cur_menu[0];
        if (cur_menu == "sy") {
            $("#menu_sy").removeClass('shouye').addClass('current');
        }
        $('#menu_' + cur_menu[0]).click();
        $('#menu_' + cur_menu[0]).find("img").attr("src", "http://img1.isou365.cn/paimai/yunying/images/yun_jie.jpg");
        $(".mianL").css("height", $(document).height() - 95);
        $('#menu_' + cur_menu[1]).addClass('current');
    });
</script>
    <div class="mianR">
    	<div style="display:none;" id="inputBox">
    		
    	</div>
        <div class="yuyue">
            <ul>
                <li onclick="getAuditPicList(2,1);" class="yuCurrent">待审核</li>
				<li onclick="getAuditPicList(1,1);">已通过</li>
            </ul>
        </div>
        <div class="listBox" id="listBox">
        	<div class="yuList">
        		<div class="audit-picture-title" id="pending-audit">
        		</div>
        	</div>
        	<div class="yuList" style="display: none;">
        		<div class="audit-picture-title" id="already-passed">
        		</div>
        	</div>       	
        </div>
    </div>
</div>
 <div class="yunBei"></div>
<div class="loading"></div>
<script>

var questionList = [];
var question_num = 0;

function audit(obj){
	var num=0;			
	$(obj).find("ul li").on("click",function(){		
		var id = $(this).children('img').attr('data');
		if($(this).hasClass("cuurent")){
			num--;		
			$(this).removeClass("cuurent");				
			$(obj).find(".audit-title").find(".stretched").html(num);
			$('#img_'+id).remove();
			$('#passed_id').append('<input type="hidden" id="audit_'+id+'" value="'+id+'" />');
		}else{
			$('#inputBox').append('<input type="hidden" id="img_'+id+'" value="'+id+'" />');
			$('#audit_'+id).remove();
			num++;
			$(this).addClass("cuurent");
			$(obj).find(".audit-title").find(".stretched").html(num);	
		}		
		
		questionList = [];
		$(obj).find("ul li.cuurent").each(function(){
			var questionid = $(this).children('img').attr('questionid');
			questionList[questionid] = 1;
			
		});
		question_num = 0;
		for(var i in questionList){
			question_num ++;
		}
		$('.question_num').html(question_num);
		
	})
}	

audit("#already-passed");
	
var p = 0;
var s = 2;
function getAuditPicList(status,page){
	$('#inputBox').val('');
	p = page;
	s = status;
	$.get('/Question/getPicList',{status:status,p:page}, function(data){
		if(status == 2){
			$('#pending-audit').html(data);
			audit("#pending-audit");
		}else{
			$('#already-passed').html(data);
			audit("#already-passed");
		}
		
	});
}
getAuditPicList(2,1);


function get_page(page){
	getAuditPicList(s,page);
}
function doAudit(){
	var illegal = [];
	$('#inputBox input').each(function(){
		illegal.push($(this).val());
	});
	
	var pass = [];
	$('#passed_id input').each(function(){
		pass.push($(this).val());
	});

	$.post('/Question/audit', {illegal:illegal,pass:pass}, function(data){
		if(data.code == 200){
			get_page(p);
		}else{
			alert('图片审核失败，请重试');
		}
	},'json');
}

function delPic(){
	var illegal = [];
	$('#inputBox input').each(function(){
		illegal.push($(this).val());
	});

	$.post('/Question/delPic', {illegal:illegal}, function(data){
		if(data.code == 200){
			get_page(p);
		}else{
			alert('图片删除失败，请重试');
		}
	},'json');
}
	
</script>
<div class="yunBei"></div>
<div class="loading"></div>
</body>
</html>